home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_03
/
v7n3046a.txt
< prev
next >
Wrap
Text File
|
1989-01-02
|
591b
|
29 lines
main()
{
int i = 10;
const ci = 20;
int *pi = &i;
const int *pci = &ci;
int * const cpi = &i;
const int * const cpci = &ci;
pi = &i; /* OK */
*pi = 20; /* OK */
/*1*/ pi = &ci; /* error */
pci = &ci; /* OK */
*pci = 25; /* error */
/*2*/ pci = &i; /* OK */
*pci = 25; /* error */
*cpi = 10; /* OK */
cpi = &i; /* error */
*cpci = 10; /* error */
cpci = &ci; /* error */
}